<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<c:url value="/css/style.css"/>" />
<title>Article Search screen</title>
</head>
<body>

	<table border="0" width = "80%" align="center">
		<tr>
			<td>				
				<jsp:include page="header.jsp" />   							
			</td>
		</tr>
		<tr>
			<td>
				<!-- <b><bean:message key="articleSearch.title" /></b> -->
				<div style="color: red">
					<bean:write name="articleSearchForm" property="message1"/>
					<html:errors />
				</div>
				<jsp:include page="search.jsp" />
			</td>
		</tr>
		<tr>
			<td>
				<bean:write name="articleSearchForm" property="message2"/>				
            </td>					
		</tr>
		<tr>
			<td>
				<table border="0" width = "100%">					
				<logic:iterate name="articleSearchForm" property="articleDTOList" id="data">
					<tr>
						<td>
							<div style="color: red">
								<c:if test="${data.deleted == true}">
									Deleted article! Should be hidden.
								</c:if>
							</div> 		
						</td>					
					</tr>
					<tr>
						<td>
							<!-- Title: -->
							<a href="articlePresentationAction.do?articleId=${data.articleId}" >
								<b><bean:write name="data" property="title" /></b>
							</a>		
						</td>					
					</tr>
					<tr>
						<td bgcolor = "#f5f5f5">
							<author>
							<!-- Author : -->
								<bean:write name="data" property="byline.author" />
								<bean:write name="data" property="byline.timestamp" />
								<bean:write name="data" property="byline.ip" />
								<bean:write name="data" property="byline.rating" />
								<bean:write name="data" property="byline.hitCount" />
							</author>
						</td>					
					</tr>
					<tr>
						<td>
							<!-- Summary : -->
							<!--<bean:write name="data" property="summary" />...-->
							<c:out value="${data.summary}" escapeXml="false" />...
							<a href="articlePresentationAction.do?articleId=${data.articleId}" >
								<i>read more</i>
							</a>	
						</td>					
					</tr>
					
					<tr>
						<td>
							<!-- &nbsp; -->
						</td>					
					</tr>			
					</logic:iterate>					
				</table>
			</td>
		</tr>
		<tr>
			<td>				
				<jsp:include page="footer.jsp" />	
			</td>
		</tr>
	</table>
</body>
</html>
